package com.hoshino.momochi.service.Impl;

import com.hoshino.momochi.mapper.HistoryReadMapper;
import com.hoshino.momochi.model.domain.Blog;
import com.hoshino.momochi.model.domain.HistoryRead;
import com.hoshino.momochi.service.HistoryReadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HistoryReadServiceImpl implements HistoryReadService {

    @Autowired
    private HistoryReadMapper historyReadMapper;

    @Override
    public List<Blog> getHistoryByUserId(HistoryRead historyRead) {
        return historyReadMapper.getHistoryByUserId(historyRead);
    }

    @Override
    public void delHistory(Long uid, List<Long> arr) {
        historyReadMapper.delHistory(uid, arr);
    }

    @Override
    public void addHistoryRead(HistoryRead historyRead) {
        historyReadMapper.addHistoryRead(historyRead);
    }

    @Override
    public Long checkHaveHistory(Long user_id, Long blog_id) {
        return historyReadMapper.checkHaveHistory(user_id, blog_id);
    }

    @Override
    public void delIsDeleteAsTrue() {
        historyReadMapper.delIsDeleteAsTrue();
    }
}
